package com.zw.pm.module.board.multi;


import com.zw.pm.gen.entity.Factory;
import com.zw.pm.module.config.factory.FactoryDao;
import com.zw.pm.module.project.build.ProjectDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Description: 项目 服务层
 * @Author: China.sgl
 * @Date: 2019/9/16 09:11
 */
@Service
public class MultiService {

    @Autowired
    private ProjectDao projectDao;
    @Autowired
    private FactoryDao factoryDao;

    /**
     * 查询生产厂
     *
     * @return list
     */
    public List<FactoryModel> findFactories() {
        List<FactoryModel> factoryModelList = factoryDao.findFactorModelIdNotIn(new Integer[]{4});
        for (FactoryModel factoryModel : factoryModelList) {
            if (factoryModel.getCode().equals("F1")) {
                factoryModel.setPageName("一厂 - 生产铝模板");
            } else if (factoryModel.getCode().equals("F2")) {
                factoryModel.setPageName("二厂 - 生产铝模板");
            } else if (factoryModel.getCode().equals("F3")) {
                factoryModel.setPageName("三厂 - 生产铝模板");
            } else if (factoryModel.getCode().equals("F4")) {
                factoryModel.setPageName("四厂 - 负责包装运输");
            } else if (factoryModel.getCode().equals("F5")) {
                factoryModel.setPageName("五厂 - 生产铝背楞");
            }
        }
        return factoryModelList;
    }

    /**
     * 根据条件查询项目
     *
     * @param multiModel 查询条件
     * @return 项目列表数据
     */
    public List<MultiModel> findProject(MultiModel multiModel) {
        return projectDao.findMulti(multiModel);
    }

    /**
     *@FunctionName: findclientList
     *@Description: 获取客户列表
     *@Author: 徐一贺
     *@CreateDate: 2020/3/21 10:23
     *@Phone: 18210416791
     *@Param:
     *@Return:  List<MultiModel> 客户列表
     *@Version: 1.0.0
     */
    public List<MultiModel> findclientList() {
        return projectDao.findclientList();
    }
}
